package com.javasm.service.B2cOrderService.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageInfo;
import com.javasm.domin.entity.orderEntity.B2cOrderGoods;
import com.javasm.domin.entity.orderEntity.B2cShoppingcart;
import com.javasm.domin.vo.orderVo.OrderGoodVo;
import com.javasm.domin.vo.orderVo.OrderShoppingVo;
import com.javasm.mapper.B2cOrderMapper.B2cShoppingcartMapper;
import com.javasm.service.B2cOrderService.B2cShoppingcartService;
import com.javasm.transfer.orderTransfer.OrderShoppingTranfer;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author Administrator
* @description 针对表【b2c_shoppingcart】的数据库操作Service实现
* @createDate 2021-11-25 21:09:02
*/
@Service
@RequiredArgsConstructor
public class B2cShoppingcartServiceImpl extends ServiceImpl<B2cShoppingcartMapper, B2cShoppingcart>
implements B2cShoppingcartService {

    private  final  B2cShoppingcartMapper b2cShoppingcartMapper;
    private  final OrderShoppingTranfer orderShoppingTranfer;

    /**
     * 购物车转义
     * @return
     */
    @Override
    public List<OrderShoppingVo> findShoppingList() {

        List<B2cShoppingcart> b2cShoppingcarts = b2cShoppingcartMapper.selectList(null);

        //转vo
        List<OrderShoppingVo> orderShoppingVos = orderShoppingTranfer.setString(b2cShoppingcarts);

        return orderShoppingVos;
    }
}
